﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Text;

namespace BusinessLogic
{
    public class AddEditCarAdvanceCommand : BaseCommand<object>
    {
        public AddEditCarAdvanceCommand(int userId,string dealerCode,string vin)
        {
            int TimeZoneDiff = Convert.ToInt32(ConfigurationManager.AppSettings["TimeZoneDiff"].ToString());
            SetQuery(string.Format("update acm_car_advance set user_id={0},dealer_code='{1}',tx_date={3} where vin='{2}'", userId.ToString(), dealerCode, vin, DateTime.Now.AddHours(TimeZoneDiff).ToString("'dd/mm/yyyy'")));
        }

        public override void Command()
        {
            Result = cmd.ExecuteNonQuery();
        }
    }
}
